signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ScatterChartPanel { /** * Determines the required space ( in points ) for painting ticks for the coordinate axis of the given dimension . * The basic assumption here is , that the first dimension ( X ) is drawed horizontally and the second dimension ( Y ) is drawed vertically . * @ param dim Reference ...
int requiredPointsPerTick = getGraphics ( ) . getFontMetrics ( ) . getHeight ( ) ; if ( dim == ValueDimension . X ) { int first = getGraphics ( ) . getFontMetrics ( ) . stringWidth ( String . format ( getTickInfo ( dim ) . getFormat ( ) , getTickInfo ( dim ) . getFirstTick ( ) ) ) ; int last = getGraphics ( ) . getFont...
public class LastfmCelma1KParser { /** * { @ inheritDoc } */ @ Override public DataModelIF < Long , Long > parseData ( final File f , final String mapIdsPrefix ) throws IOException { } }
return parseTemporalData ( f , mapIdsPrefix ) ;
public class VFS { /** * Find a virtual file . * @ param uri the URI whose path component is the child path * @ return the child * @ throws IllegalArgumentException if the path is null */ public static VirtualFile getChild ( URI uri ) { } }
String path = uri . getPath ( ) ; if ( path == null ) { path = uri . getSchemeSpecificPart ( ) ; } return getChild ( path ) ;
public class CookieDateUtil { /** * Parses the date value using the given date formats . * @ param dateValue the date value to parse * @ param dateFormats the date formats to use * @ return the parsed date */ @ Nullable public static Date parseDate ( String dateValue , Collection < String > dateFormats ) { } }
return parseDate ( dateValue , dateFormats , DEFAULT_TWO_DIGIT_YEAR_START ) ;
public class BasicBinder { /** * Register a Marshaller with the given source and target class . * The marshaller is used as follows : Instances of the source can be marshalled into the target class . * @ param source The source ( input ) class * @ param target The target ( output ) class * @ param converter The...
Class < ? extends Annotation > scope = matchImplementationToScope ( converter . getClass ( ) ) ; registerMarshaller ( new ConverterKey < S , T > ( source , target , scope == null ? DefaultBinding . class : scope ) , converter ) ;
public class SimpleSeekableFormatOutputStream { /** * Take the current data segment , optionally compress it , * calculate the crc32 , and then write it out . * The method sets the lastOffsets to the end of the file before it starts * writing . That means the offsets in the MetaDataBlock will be after the * end...
// Do not do anything if no data has been written if ( currentDataSegmentBuffer . size ( ) == 0 ) { return ; } // Create the current DataSegment DataSegmentWriter currentDataSegment = new DataSegmentWriter ( currentDataSegmentBuffer , codec , codecCompressor ) ; // Update the metadata updateMetadata ( currentDataSegmen...
public class OtpErlangRef { /** * Compute the hashCode value for a given ref . This function is compatible * with equal . * @ return the hashCode of the node . */ @ Override protected int doHashCode ( ) { } }
final OtpErlangObject . Hash hash = new OtpErlangObject . Hash ( 7 ) ; hash . combine ( creation , ids [ 0 ] ) ; if ( isNewRef ( ) ) { hash . combine ( ids [ 1 ] , ids [ 2 ] ) ; } return hash . valueOf ( ) ;
public class ListColumnReader { /** * Each collection ( Array or Map ) has four variants of presence : * 1 ) Collection is not defined , because one of it ' s optional parent fields is null * 2 ) Collection is null * 3 ) Collection is defined but empty * 4 ) Collection is defined and not empty . In this case of...
int maxDefinitionLevel = field . getDefinitionLevel ( ) ; int maxElementRepetitionLevel = field . getRepetitionLevel ( ) + 1 ; boolean required = field . isRequired ( ) ; int offset = 0 ; offsets . add ( offset ) ; for ( int i = 0 ; i < definitionLevels . length ; i = getNextCollectionStartIndex ( repetitionLevels , ma...
public class SerializedFormBuilder { /** * Build the serial UID information for the given class . * @ param node the XML element that specifies which components to document * @ param classTree content tree to which the serial UID information will be added */ public void buildSerialUIDInfo ( XMLNode node , Content c...
Content serialUidTree = writer . getSerialUIDInfoHeader ( ) ; for ( Element e : utils . getFieldsUnfiltered ( currentTypeElement ) ) { VariableElement field = ( VariableElement ) e ; if ( field . getSimpleName ( ) . toString ( ) . compareTo ( SERIAL_VERSION_UID ) == 0 && field . getConstantValue ( ) != null ) { writer ...
public class FileUtils { /** * Sorts file list , using this rules : directories first , sorted using provided comparator , then files sorted using provided comparator . * @ param files list to sort * @ param comparator comparator used to sort files list * @ param descending if true then sorted list will be in rev...
Array < FileHandle > directoriesList = new Array < FileHandle > ( ) ; Array < FileHandle > filesList = new Array < FileHandle > ( ) ; for ( FileHandle f : files ) { if ( f . isDirectory ( ) ) { directoriesList . add ( f ) ; } else { filesList . add ( f ) ; } } Sort sorter = new Sort ( ) ; sorter . sort ( directoriesLis...
public class PrefsInterface { /** * Returns the default safety level preference for the user . * @ see com . flickr4java . flickr . Flickr # SAFETYLEVEL _ MODERATE * @ see com . flickr4java . flickr . Flickr # SAFETYLEVEL _ RESTRICTED * @ see com . flickr4java . flickr . Flickr # SAFETYLEVEL _ SAFE * @ return T...
Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_SAFETY_LEVEL ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErro...
public class AOValue { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . impl . store . items . SIMPItem # getPersistentData ( java . io . ObjectOutputStream ) */ public void getPersistentData ( ObjectOutputStream dout ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getPersistentData" , dout ) ; try { dout . writeLong ( tick ) ; dout . writeLong ( msgId ) ; dout . writeInt ( storagePolicy ) ; dout . writeLong ( plockId ) ; dout . writeLong ( prevTick ) ; dout . writeLong ( waitTime ) ;...
public class CmsCategoryField { /** * Builds a tree item for the given category . < p > * @ param category the category * @ param selectedCategories the selected categories * @ param inactive true if the value should be displayed inactive * @ return the tree item widget */ private CmsTreeItem buildTreeItem ( Cm...
CmsDataValue categoryTreeItem = new CmsDataValue ( 500 , 4 , CmsCategoryBean . SMALL_ICON_CLASSES , category . getTitle ( ) , category . getPath ( ) ) ; if ( inactive ) { categoryTreeItem . setInactive ( ) ; } categoryTreeItem . setTitle ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( category . getDescription ( ) ) ? c...
public class ButtonBarDialogDecorator { /** * Inflates the layout , which is used to show the dialog ' s buttons . * @ return The view , which has been inflated , as an instance of the class { @ link View } or null , * if no view has been inflated */ private View inflateButtonBar ( ) { } }
if ( getRootView ( ) != null ) { if ( buttonBarContainer == null ) { LayoutInflater layoutInflater = LayoutInflater . from ( getContext ( ) ) ; buttonBarContainer = ( ViewGroup ) layoutInflater . inflate ( R . layout . button_bar_container , getRootView ( ) , false ) ; buttonBarDivider = buttonBarContainer . findViewBy...
public class Bytes { /** * Put a long value out to the specified byte array position . * @ param bytes the byte array * @ param offset position in the array * @ param val long to write out * @ return incremented offset * @ throws IllegalArgumentException if the byte array given doesn ' t have * enough room ...
if ( bytes . length - offset < SIZEOF_LONG ) { throw new IllegalArgumentException ( "Not enough room to put a long at" + " offset " + offset + " in a " + bytes . length + " byte array" ) ; } for ( int i = offset + 7 ; i > offset ; i -- ) { bytes [ i ] = ( byte ) val ; val >>>= 8 ; } bytes [ offset ] = ( byte ) val ; re...
public class LObjIntCharFunctionBuilder { /** * 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 < T , R > LObjIntCharFunction < T , R > objIntCharFunctionFrom ( Consumer < LObjIntCharFunctionBuilder < T ,...
LObjIntCharFunctionBuilder builder = new LObjIntCharFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class DefaultCasWebflowExecutionPlan { /** * Execute the plan . */ public void execute ( ) { } }
OrderComparator . sortIfNecessary ( webflowConfigurers ) ; webflowConfigurers . forEach ( c -> { LOGGER . trace ( "Registering webflow configurer [{}]" , c . getName ( ) ) ; c . initialize ( ) ; } ) ;
public class L2Cache { /** * Retrieves a list of entities from the cache . If the cache doesn ' t yet exist , will create the * cache . * @ param repository the underlying repository , used to create the cache loader or to retrieve the * existing cache * @ param ids { @ link Iterable } of the ids of the entitie...
try { return getEntityCache ( repository ) . getAll ( ids ) . values ( ) . stream ( ) . filter ( Optional :: isPresent ) . map ( Optional :: get ) . map ( e -> entityHydration . hydrate ( e , repository . getEntityType ( ) ) ) . collect ( Collectors . toList ( ) ) ; } catch ( ExecutionException exception ) { // rethrow...
public class Contexts { /** * Serializes an instance context to JSON . * @ param context The context to serialize . * @ return The serialized context . */ public static JsonObject serialize ( InstanceContext context ) { } }
return serialize ( context . uri ( ) , context . component ( ) . network ( ) ) ;
public class JulianDay { /** * obtains the JD - value for given moment and scale */ static double getValue ( Moment moment , TimeScale scale ) { } }
long elapsedTime = moment . getElapsedTime ( scale ) + jdOffset ( scale ) ; int nano = moment . getNanosecond ( scale ) ; double secs = elapsedTime + nano / ( MRD * 1.0 ) ; return secs / DAY_IN_SECONDS ;
public class PolicyAssignmentsInner { /** * Gets policy assignments for the resource group . * @ param resourceGroupName The name of the resource group that contains policy assignments . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; ...
return listByResourceGroupWithServiceResponseAsync ( resourceGroupName ) . map ( new Func1 < ServiceResponse < Page < PolicyAssignmentInner > > , Page < PolicyAssignmentInner > > ( ) { @ Override public Page < PolicyAssignmentInner > call ( ServiceResponse < Page < PolicyAssignmentInner > > response ) { return response...
public class AbstractRoxConfigurableClientMojo { /** * Clean the ROX configuration files * @ throws MojoExecutionException Throws when error occurred in the clean plugin */ @ Override protected void cleanup ( ) throws MojoExecutionException { } }
if ( verbose ) { getLog ( ) . info ( "Clean the rox configuration files" ) ; } if ( roxActive ) { // Cleanup the rox configuration files useCleanPlugin ( element ( "filesets" , element ( "fileset" , element ( "directory" , getWorkingDirectory ( ) . getAbsolutePath ( ) ) , element ( "followSymlinks" , "false" ) , elemen...
public class GroupTypeMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GroupType groupType , ProtocolMarshaller protocolMarshaller ) { } }
if ( groupType == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( groupType . getGroupName ( ) , GROUPNAME_BINDING ) ; protocolMarshaller . marshall ( groupType . getUserPoolId ( ) , USERPOOLID_BINDING ) ; protocolMarshaller . marshall ( gro...
public class SeleniumSelectField { /** * { @ inheritDoc } If the option text passed contains " submit : : " in the string , * the submit value is searched , not the text inside of the option . */ @ Override public final void select ( final String optionText ) { } }
if ( optionText . contains ( "submit::" ) ) { String value = optionText . split ( "::" ) [ 1 ] ; select ( Type . VALUE , value ) ; } else { select ( Type . TEXT , optionText ) ; }
public class DataModelSerializer { /** * A little utility to convert from Type to Class . < br > * The method is only complete enough for the usage within this class , it won ' t handle [ ] arrays , or primitive types , etc . * @ param t the Type to return a Class for , if the Type is parameterized , the actual typ...
if ( t instanceof Class ) { return ( Class < ? > ) t ; } else if ( t instanceof ParameterizedType ) { ParameterizedType pt = ( ParameterizedType ) t ; return getClassForType ( pt . getActualTypeArguments ( ) [ 0 ] ) ; } else if ( t instanceof GenericArrayType ) { throw new IllegalStateException ( "Data Model Error: Sim...
public class JSDocInfoBuilder { /** * Records a type transformation expression together with its template * type name . */ public boolean recordTypeTransformation ( String name , Node expr ) { } }
if ( currentInfo . declareTypeTransformation ( name , expr ) ) { populated = true ; return true ; } else { return false ; }
public class HttpSupport { /** * Convenience method for downloading files . This method will force the browser to find a handler ( external program ) * for this file ( content type ) and will provide a name of file to the browser . This method sets an HTTP header * " Content - Disposition " based on a file name . ...
try { FileResponse resp = new FileResponse ( file , delete ) ; RequestContext . setControllerResponse ( resp ) ; HttpBuilder builder = new HttpBuilder ( resp ) ; builder . header ( "Content-Disposition" , "attachment; filename=" + file . getName ( ) ) ; return builder ; } catch ( Exception e ) { throw new ControllerExc...
public class SpecParser { /** * to add special logic to detect this case . */ private boolean constructorMayHaveBeenAddedByCompiler ( ConstructorNode constructor ) { } }
Parameter [ ] params = constructor . getParameters ( ) ; Statement firstStat = constructor . getFirstStatement ( ) ; return AstUtil . isJointCompiled ( spec . getAst ( ) ) && constructor . isPublic ( ) && params != null && params . length == 0 && firstStat == null ;
public class VertxActivation { /** * Start the activation * @ throws ResourceException * Thrown if an error occurs */ public void start ( ) throws ResourceException { } }
if ( ! deliveryActive . get ( ) ) { VertxPlatformFactory . instance ( ) . getOrCreateVertx ( config , this ) ; VertxPlatformFactory . instance ( ) . addVertxHolder ( this ) ; } setup ( ) ;
public class TakeScreenshotOnFailureRule { /** * Saves the actual screenshot without interrupting the running of the * tests . It will log an error if unable to store take the screenshot . * @ param file * the file that will store the screenshot */ private void silentlySaveScreenshotTo ( final File file ) { } }
try { saveScreenshotTo ( file ) ; LOG . info ( "Screenshot saved: " + file . getAbsolutePath ( ) ) ; } catch ( Exception e ) { LOG . warn ( "Error while taking screenshot " + file . getName ( ) + ": " + e ) ; }
public class SolutionListUtils { /** * Finds the index of the best solution in the list according to a comparator * @ param solutionList * @ param comparator * @ return The index of the best solution */ public static < S > int findIndexOfBestSolution ( List < S > solutionList , Comparator < S > comparator ) { } }
if ( solutionList == null ) { throw new NullSolutionListException ( ) ; } else if ( solutionList . isEmpty ( ) ) { throw new EmptySolutionListException ( ) ; } else if ( comparator == null ) { throw new JMetalException ( "The comparator is null" ) ; } int index = 0 ; S bestKnown = solutionList . get ( 0 ) ; S candidate...
public class CClassNode { /** * onig _ is _ code _ in _ cc */ public boolean isCodeInCC ( Encoding enc , int code ) { } }
int len ; if ( enc . minLength ( ) > 1 ) { len = 2 ; } else { len = enc . codeToMbcLength ( code ) ; } return isCodeInCCLength ( len , code ) ;
public class AWSOpsWorksClient { /** * Deletes a user profile . * < b > Required Permissions < / b > : To use this action , an IAM user must have an attached policy that explicitly grants * permissions . For more information about user permissions , see < a * href = " http : / / docs . aws . amazon . com / opswor...
request = beforeClientExecution ( request ) ; return executeDeleteUserProfile ( request ) ;
public class BugInstance { /** * Add a method annotation . If this is the first method annotation added , it * becomes the primary method annotation . * @ param className * name of the class containing the method * @ param methodName * name of the method * @ param methodSig * type signature of the method ...
addMethod ( MethodAnnotation . fromForeignMethod ( className , methodName , methodSig , accessFlags ) ) ; return this ;
public class SequenceRenderer { /** * Get the transform associated to the filter keeping screen scale independent . * @ return The associated transform instance . */ private Transform getTransform ( ) { } }
final Resolution output = config . getOutput ( ) ; final double scaleX = output . getWidth ( ) / ( double ) source . getWidth ( ) ; final double scaleY = output . getHeight ( ) / ( double ) source . getHeight ( ) ; return filter . getTransform ( scaleX , scaleY ) ;
public class ECKey { /** * < p > Verifies the given ECDSA signature against the message bytes using the public key bytes . < / p > * < p > When using native ECDSA verification , data must be 32 bytes , and no element may be * larger than 520 bytes . < / p > * @ param data Hash of the data to verify . * @ param ...
if ( FAKE_SIGNATURES ) return true ; if ( Secp256k1Context . isEnabled ( ) ) { try { return NativeSecp256k1 . verify ( data , signature . encodeToDER ( ) , pub ) ; } catch ( NativeSecp256k1Util . AssertFailException e ) { log . error ( "Caught AssertFailException inside secp256k1" , e ) ; return false ; } } ECDSASigner...
public class HttpSender { /** * Helper method that sends the request of the given HTTP { @ code message } with the given configurations . * No redirections are followed ( see { @ link # followRedirections ( HttpMessage , HttpRequestConfig ) } ) . * @ param message the message that will be sent . * @ param request...
if ( log . isDebugEnabled ( ) ) { log . debug ( "Sending " + message . getRequestHeader ( ) . getMethod ( ) + " " + message . getRequestHeader ( ) . getURI ( ) ) ; } message . setTimeSentMillis ( System . currentTimeMillis ( ) ) ; try { if ( requestConfig . isNotifyListeners ( ) ) { notifyRequestListeners ( message ) ;...
public class Navigator { /** * Navigates to the screen on top of the back stack after the HistoryRewriter has rewritten the back stack history . * Animates the navigation according to the NavigationType parameter . * @ param historyRewriter manipulates the back stack during navigation * @ param navType controls h...
navigate ( FORWARD , navType , new Runnable ( ) { @ Override public void run ( ) { historyRewriter . rewriteHistory ( backStack ) ; } } ) ;
public class ReservoirItemsUnion { /** * Union the given sketch . This method can be repeatedly called . If the given sketch is null it is * interpreted as an empty sketch . * @ param sketchIn The incoming sketch . */ public void update ( final ReservoirItemsSketch < T > sketchIn ) { } }
if ( sketchIn == null ) { return ; } final ReservoirItemsSketch < T > ris = ( sketchIn . getK ( ) <= maxK_ ? sketchIn : sketchIn . downsampledCopy ( maxK_ ) ) ; // can modify the sketch if we downsampled , otherwise may need to copy it final boolean isModifiable = ( sketchIn != ris ) ; if ( gadget_ == null ) { createNe...
public class ConnectedStreams { /** * KeyBy operation for connected data stream . Assigns keys to the elements of * input1 and input2 using keySelector1 and keySelector2. * @ param keySelector1 * The { @ link KeySelector } used for grouping the first input * @ param keySelector2 * The { @ link KeySelector } u...
return new ConnectedStreams < > ( environment , inputStream1 . keyBy ( keySelector1 ) , inputStream2 . keyBy ( keySelector2 ) ) ;
public class JettyHandler { /** * handle http request . * @ param target * @ param request * @ param response * @ param i * @ throws IOException * @ throws ServletException */ @ Override public void handle ( final String target , final HttpServletRequest request , final HttpServletResponse response , final ...
LOG . log ( Level . INFO , "JettyHandler handle is entered with target: {0} " , target ) ; final Request baseRequest = ( request instanceof Request ) ? ( Request ) request : HttpConnection . getCurrentConnection ( ) . getRequest ( ) ; response . setContentType ( "text/html;charset=utf-8" ) ; final ParsedHttpRequest par...
public class AbstractStreamEx { /** * Returns a stream consisting of all elements from this stream starting * from the first element which does not match the given predicate . If the * predicate is true for all stream elements , an empty stream is returned . * This is a stateful operation . It can be either < a ...
Objects . requireNonNull ( predicate ) ; return VER_SPEC . callWhile ( this , predicate , true ) ;
public class CFTree { /** * Rebuild the CFTree to condense it to approximately half the size . */ protected void rebuildTree ( ) { } }
final int dim = root . getDimensionality ( ) ; double t = estimateThreshold ( root ) / leaves ; t *= t ; // Never decrease the threshold . thresholdsq = t > thresholdsq ? t : thresholdsq ; LOG . debug ( "New squared threshold: " + thresholdsq ) ; LeafIterator iter = new LeafIterator ( root ) ; // Will keep the old root...
public class ControlFactory { /** * Returns a new { @ link FieldControl } instance . The element passed either has to be of type * { @ link XMLTags # FIELD } or { @ link XMLTags # FIELD _ REF } or at least contain one of these tags . */ public FieldControl getControl ( final MathRandom random , Element element , fina...
if ( finder == null ) { finder = new XmlElementFinder ( element . getDocument ( ) ) ; } Element fieldElement = element . getChild ( XMLTags . FIELD ) ; if ( fieldElement != null ) { element = fieldElement ; } else { fieldElement = element . getChild ( XMLTags . FIELD_REF ) ; if ( fieldElement != null ) { element = find...
public class EventConsumer { /** * Gets the type parameter of the expected generic interface which is * actually used by the class of the given object . The generic * interface can be implemented by an class or interface in the object ' s * class hierarchy , * @ param object The object * @ param expectedType ...
Collection < Class < ? > > extendedAndImplementedTypes = getExtendedAndImplementedTypes ( object . getClass ( ) , new LinkedList < Class < ? > > ( ) ) ; for ( Class < ? > type : extendedAndImplementedTypes ) { Type [ ] implementedInterfaces = type . getGenericInterfaces ( ) ; for ( Type implementedInterface : implement...
public class JdbcDatabase { /** * Check out this error , see if it matches . * Note : This is not very efficient code , but error should not happen that often . * @ param ex exception thrown . * @ param iErrorType see if error matches . * @ param strErrorText String to match in the error string ( must be lower ...
boolean bFound = false ; String strError = ex . getMessage ( ) ; if ( strError != null ) strError = strError . toLowerCase ( ) ; if ( iErrorType == DBConstants . FILE_NOT_FOUND ) { if ( strError != null ) if ( strError . indexOf ( "table" ) != - 1 ) if ( strError . indexOf ( "not" ) != - 1 ) if ( ( strError . indexOf (...
public class MACPacketImpl { /** * Creates a new { @ link MACPacketImpl } and it assumes ethernet II and it * does not check whether or not the ethertype is a known type . This method * should only be used by the internal packet creating functions such as the * { @ link TransportPacketFactoryImpl } or the framers...
if ( headers . capacity ( ) < 14 ) { throw new IllegalArgumentException ( "Not enough bytes to create this header" ) ; } if ( parent == null ) { throw new IllegalArgumentException ( "The parent packet cannot be null" ) ; } return new MACPacketImpl ( Protocol . ETHERNET_II , parent , headers , null ) ;
public class TransformedCallback { /** * Create a new Callback which transforms its items according to a { @ link Function } * and then invokes the original callback . * @ param callback the callback that processes items of type B * @ param transformer the transformer that converts the item from type A to type B ...
return new TransformedCallback < A , B > ( callback , transformer ) ;
public class ChannelHelper { /** * Read length bytes from channel . * Throws EOFException if couldn ' t read length bytes because of eof . * @ param ch * @ param length * @ return * @ throws IOException */ public static final byte [ ] read ( ReadableByteChannel ch , int length ) throws IOException { } }
ByteBuffer bb = ByteBuffer . allocate ( length ) ; readAll ( ch , bb ) ; if ( bb . hasRemaining ( ) ) { throw new EOFException ( "couldn't read " + length + " bytes" ) ; } return bb . array ( ) ;
public class NotificationChannelMarshaller { /** * Marshall the given parameter object . */ public void marshall ( NotificationChannel notificationChannel , ProtocolMarshaller protocolMarshaller ) { } }
if ( notificationChannel == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( notificationChannel . getSNSTopicArn ( ) , SNSTOPICARN_BINDING ) ; protocolMarshaller . marshall ( notificationChannel . getRoleArn ( ) , ROLEARN_BINDING ) ; } catch...
public class CmsUserTable { /** * Adds given user to given IndexedContainer . < p > * @ param container to add the user to * @ param user to add */ protected void addUserToContainer ( IndexedContainer container , CmsUser user ) { } }
if ( m_blackList . contains ( user ) ) { return ; } Item item = container . addItem ( user ) ; fillItem ( item , user ) ;
public class IotHubResourcesInner { /** * Import , update , or delete device identities in the IoT hub identity registry from a blob . For more information , see : https : / / docs . microsoft . com / azure / iot - hub / iot - hub - devguide - identity - registry # import - and - export - device - identities . * Impo...
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( resourc...
public class ClusterManager { /** * add items that were not clustered in last isClustering . */ private void addLeftItems ( ) { } }
// Log . w ( TAG , " addLeftItems ( ) { . . . . ( 0 ) " ) ; if ( leftItems . size ( ) == 0 ) { return ; } // Log . w ( TAG , " addLeftItems ( ) { . . . . ( 1 ) " ) ; ArrayList < T > currentLeftItems = new ArrayList < T > ( ) ; currentLeftItems . addAll ( leftItems ) ; // Log . w ( TAG , " addLeftItems ( ) { . . . . ( 2...
public class WebcamUpdater { /** * Start updater . */ public void start ( ) { } }
if ( running . compareAndSet ( false , true ) ) { image . set ( new WebcamGetImageTask ( Webcam . getDriver ( ) , webcam . getDevice ( ) ) . getImage ( ) ) ; executor = Executors . newSingleThreadScheduledExecutor ( THREAD_FACTORY ) ; executor . execute ( this ) ; LOG . debug ( "Webcam updater has been started" ) ; } e...
public class GrailsClassUtils { /** * Returns whether the specified class is either within one of the specified packages or * within a subpackage of one of the packages * @ param theClass The class * @ param packageList The list of packages * @ return true if it is within the list of specified packages */ publi...
String classPackage = theClass . getPackage ( ) . getName ( ) ; for ( Object packageName : packageList ) { if ( packageName != null ) { if ( classPackage . startsWith ( packageName . toString ( ) ) ) { return true ; } } } return false ;
public class JsonRuleParser { /** * 解析 * @ param jsonRule * @ return */ public Object parse ( JsonRule jsonRule ) { } }
// filter for ( IRuleFilter ruleFilter : ruleFilters ) { ruleFilter . doFilter ( jsonRule , builderType ) ; } // parse if ( jsonRule . isGroup ( ) ) { return groupParser . parse ( jsonRule , this ) ; } else { for ( IRuleParser ruleParser : ruleParsers ) { if ( ruleParser . canParse ( jsonRule ) ) { return ruleParser . ...
public class RealVoltDB { /** * Thread safe */ @ Override public void setReplicationActive ( boolean active ) { } }
if ( m_replicationActive . compareAndSet ( ! active , active ) ) { try { JSONStringer js = new JSONStringer ( ) ; js . object ( ) ; js . keySymbolValuePair ( "active" , m_replicationActive . get ( ) ) ; js . endObject ( ) ; getHostMessenger ( ) . getZK ( ) . setData ( VoltZK . replicationconfig , js . toString ( ) . ge...
public class TieredBlockStore { /** * Removes a block . * @ param sessionId session id * @ param blockId block id * @ param location the source location of the block * @ throws InvalidWorkerStateException if the block to remove is a temp block * @ throws BlockDoesNotExistException if this block can not be fou...
long lockId = mLockManager . lockBlock ( sessionId , blockId , BlockLockType . WRITE ) ; try { String filePath ; BlockMeta blockMeta ; try ( LockResource r = new LockResource ( mMetadataReadLock ) ) { if ( mMetaManager . hasTempBlockMeta ( blockId ) ) { throw new InvalidWorkerStateException ( ExceptionMessage . REMOVE_...
public class BoxApiFolder { /** * Gets a request that deletes a folder * @ param id id of folder to delete * @ return request to delete a folder */ public BoxRequestsFolder . DeleteFolder getDeleteRequest ( String id ) { } }
BoxRequestsFolder . DeleteFolder request = new BoxRequestsFolder . DeleteFolder ( id , getFolderInfoUrl ( id ) , mSession ) ; return request ;
public class DataIO { /** * Writes UTF - 8 encoded characters to the given stream , but does not write * the length . * @ param workspace temporary buffer to store characters in */ public static final void writeUTF ( DataOutput out , String str , char [ ] workspace ) throws IOException { } }
writeUTF ( out , str , 0 , str . length ( ) , workspace ) ;
public class HotdeployHttpSession { public Object getAttribute ( final String name ) { } }
assertActive ( ) ; if ( attributes . containsKey ( name ) ) { return attributes . get ( name ) ; } Object value = originalSession . getAttribute ( name ) ; if ( value instanceof SerializedObjectHolder ) { value = ( ( SerializedObjectHolder ) value ) . getDeserializedObject ( ) ; if ( value != null ) { attributes . put ...
public class ServerImpl { /** * Sets the nickname of the user . * @ param user The user . * @ param nickname The nickname to set . */ public void setNickname ( User user , String nickname ) { } }
nicknames . compute ( user . getId ( ) , ( key , value ) -> nickname ) ;
public class ByteArrayInput { /** * Resets the offset and the limit of the internal buffer . */ public ByteArrayInput reset ( int offset , int len ) { } }
if ( len < 0 ) throw new IllegalArgumentException ( "length cannot be negative." ) ; this . offset = offset ; this . limit = offset + len ; return this ;
public class CmsStringUtil { /** * Splits a String into substrings along the provided char delimiter and returns * the result as an Array of Substrings . < p > * @ param source the String to split * @ param delimiter the delimiter to split at * @ return the Array of splitted Substrings */ public static String [...
List < String > result = splitAsList ( source , delimiter ) ; return result . toArray ( new String [ result . size ( ) ] ) ;
public class JCalValue { /** * Parses this jCal value as an object property value . * @ return the object or an empty map if not found */ public ListMultimap < String , String > asObject ( ) { } }
if ( values . isEmpty ( ) ) { return new ListMultimap < String , String > ( 0 ) ; } Map < String , JsonValue > map = values . get ( 0 ) . getObject ( ) ; if ( map == null ) { return new ListMultimap < String , String > ( 0 ) ; } ListMultimap < String , String > values = new ListMultimap < String , String > ( ) ; for ( ...
public class DTDNmTokenAttr { /** * Method called by the validator * to ask attribute to verify that the default it has ( if any ) is * valid for such type . */ @ Override public void validateDefault ( InputProblemReporter rep , boolean normalize ) throws XMLStreamException { } }
String def = validateDefaultNmToken ( rep , normalize ) ; if ( normalize ) { mDefValue . setValue ( def ) ; }
public class ExcelReader { /** * 转换标题别名 , 如果没有别名则使用原标题 , 当标题为空时 , 列号对应的字母便是header * @ param headerList 原标题列表 * @ return 转换别名列表 */ private List < String > aliasHeader ( List < Object > headerList ) { } }
final int size = headerList . size ( ) ; final ArrayList < String > result = new ArrayList < > ( size ) ; if ( CollUtil . isEmpty ( headerList ) ) { return result ; } for ( int i = 0 ; i < size ; i ++ ) { result . add ( aliasHeader ( headerList . get ( i ) , i ) ) ; } return result ;
public class GrailsASTUtils { /** * Adds the given expression as a member of the given annotation * @ param annotationNode The annotation node * @ param memberName The name of the member * @ param expression The expression */ public static void addExpressionToAnnotationMember ( AnnotationNode annotationNode , Str...
Expression exclude = annotationNode . getMember ( memberName ) ; if ( exclude instanceof ListExpression ) { ( ( ListExpression ) exclude ) . addExpression ( expression ) ; } else if ( exclude != null ) { ListExpression list = new ListExpression ( ) ; list . addExpression ( exclude ) ; list . addExpression ( expression ...
public class DscConfigurationsInner { /** * Retrieve the configuration script identified by configuration name . * @ param resourceGroupName Name of an Azure Resource group . * @ param automationAccountName The name of the automation account . * @ param configurationName The configuration name . * @ throws Ille...
return getContentWithServiceResponseAsync ( resourceGroupName , automationAccountName , configurationName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class AuthyUtil { /** * Validates the request information to * @ param parameters The request parameters ( all of them ) * @ param headers The headers of the request * @ param url The url of the request . * @ param apiKey the security token from the authy library * @ return true if the signature ios va...
if ( headers == null ) throw new OneTouchException ( "No headers sent" ) ; if ( ! headers . containsKey ( HEADER_AUTHY_SIGNATURE ) ) throw new OneTouchException ( "'SIGNATURE' is missing." ) ; if ( ! headers . containsKey ( HEADER_AUTHY_SIGNATURE_NONCE ) ) throw new OneTouchException ( "'NONCE' is missing." ) ; if ( pa...
public class Math { /** * Returns the index of maximum value of an array . */ public static int whichMax ( float [ ] x ) { } }
float m = Float . NEGATIVE_INFINITY ; int which = 0 ; for ( int i = 0 ; i < x . length ; i ++ ) { if ( x [ i ] > m ) { m = x [ i ] ; which = i ; } } return which ;
public class NoteEditor { /** * This method is called from within the constructor to initialize the form . WARNING : Do NOT modify this code . The content of this method is always regenerated by the Form * Editor . */ @ SuppressWarnings ( "unchecked" ) // < editor - fold defaultstate = " collapsed " desc = " Generate...
jToolBar1 = new javax . swing . JToolBar ( ) ; buttonUndo = new javax . swing . JButton ( ) ; buttonRedo = new javax . swing . JButton ( ) ; buttonImport = new javax . swing . JButton ( ) ; buttonExport = new javax . swing . JButton ( ) ; buttonCopy = new javax . swing . JButton ( ) ; buttonPaste = new javax . swing . ...
public class GitlabAPI { /** * Updates a Project * @ param projectId The id of the project to update * @ param name The name of the project * @ param description A description for the project , null otherwise * @ param defaultBranch The branch displayed in the Gitlab UI when a user navigates to the project * ...
Query query = new Query ( ) . appendIf ( "name" , name ) . appendIf ( "description" , description ) . appendIf ( "default_branch" , defaultBranch ) . appendIf ( "issues_enabled" , issuesEnabled ) . appendIf ( "wall_enabled" , wallEnabled ) . appendIf ( "merge_requests_enabled" , mergeRequestsEnabled ) . appendIf ( "wik...
public class CmsLinkManager { /** * Returns the link for the given workplace resource . * This should only be used for resources under / system or / shared . < p < * @ param cms the current OpenCms user context * @ param resourceName the resource to generate the online link for * @ param forceSecure forces the ...
String result = substituteLinkForUnknownTarget ( cms , resourceName , forceSecure ) ; return appendServerPrefix ( cms , result , resourceName , true ) ;
public class HttpResponseHeaderDecoder { /** * Deserialize the provided headers returned from a REST API to an entity instance declared as * the model to hold ' Matching ' headers . * ' Matching ' headers are the REST API returned headers those with : * 1 . header names same as name of a properties in the entity ...
final Type deserializedHeadersType = decodeData . headersType ( ) ; if ( deserializedHeadersType == null ) { return null ; } else { final String headersJsonString = serializer . serialize ( headers , SerializerEncoding . JSON ) ; Object deserializedHeaders = serializer . deserialize ( headersJsonString , deserializedHe...
public class BundlePathMappingBuilder { /** * Normalizes two paths and joins them as a single path . * @ param prefix * the path prefix * @ param path * the path * @ param generatedResource * the flag indicating if the resource has been generated * @ return the normalized path */ private String joinPaths ...
return PathNormalizer . joinPaths ( dirName , folderName , generatedResource ) ;
public class HttpPredicate { /** * An alias for { @ link HttpPredicate # get } prefix ( / * * ) , useful for file system mapping . * Creates a { @ link Predicate } based on a URI template filtering . * This will listen for WebSocket Method . * @ return The new { @ link Predicate } . * @ see Predicate */ public ...
Objects . requireNonNull ( prefix , "Prefix must be provided" ) ; String target = prefix . startsWith ( "/" ) ? prefix : "/" . concat ( prefix ) ; // target = target . endsWith ( " / " ) ? target : prefix . concat ( " / " ) ; return new HttpPrefixPredicate ( target , method ) ;
public class HadoopConfigLoader { /** * get the loaded Hadoop config ( or fall back to one loaded from the classpath ) . */ public org . apache . hadoop . conf . Configuration getOrLoadHadoopConfig ( ) { } }
org . apache . hadoop . conf . Configuration hadoopConfig = this . hadoopConfig ; if ( hadoopConfig == null ) { if ( flinkConfig != null ) { hadoopConfig = mirrorCertainHadoopConfig ( loadHadoopConfigFromFlink ( ) ) ; } else { LOG . warn ( "Flink configuration is not set prior to loading this configuration." + " Cannot...
public class SqlBuilder { /** * 添加分页语句 * @ param pageRow * @ return */ public static String appendPageParams ( String sql , PageRow pageRow ) { } }
if ( null == pageRow ) { return sql ; } return Base . dialect . getPagingSql ( sql , pageRow ) ;
public class RandomIndexingContextGenerator { /** * Adds the index vector for each co - occurring word in the context . Index * vectors are permuted if { @ code permFunc } is not { @ code null } . When in read * only mode , only existing index vector are used . */ protected void addContextTerms ( SparseDoubleVector...
// Iterate through the words in the context . for ( String term : words ) { if ( ! term . equals ( IteratorFactory . EMPTY_TOKEN ) ) { // If in read only mode , ignore any terms that are not already in the // index map . if ( readOnly && ! indexMap . containsKey ( term ) ) continue ; // Get the index vector for the wor...
import java . util . * ; class Main { /** * Calculates the derivative of a given polynomial . The coefficients of the polynomial are provided in an input list . * The polynomial is represented as follows - coefficients [ 0 ] + coefficients [ 1 ] * x + coefficients [ 2 ] * x ^ 2 + . . . . * Args : * coefficients (...
List < Integer > result = new ArrayList < > ( ) ; for ( int i = 1 ; i < coefficients . size ( ) ; i ++ ) { result . add ( i * coefficients . get ( i ) ) ; } return result ;
public class ConstantsSummaryBuilder { /** * { @ inheritDoc } * @ throws DocletException if there is a problem while building the documentation */ @ Override public void build ( ) throws DocletException { } }
if ( writer == null ) { // Doclet does not support this output . return ; } build ( layoutParser . parseXML ( ROOT ) , contentTree ) ;
public class ReplicaSettingsDescription { /** * Replica global secondary index settings for the global table . * @ param replicaGlobalSecondaryIndexSettings * Replica global secondary index settings for the global table . */ public void setReplicaGlobalSecondaryIndexSettings ( java . util . Collection < ReplicaGlob...
if ( replicaGlobalSecondaryIndexSettings == null ) { this . replicaGlobalSecondaryIndexSettings = null ; return ; } this . replicaGlobalSecondaryIndexSettings = new java . util . ArrayList < ReplicaGlobalSecondaryIndexSettingsDescription > ( replicaGlobalSecondaryIndexSettings ) ;
public class StringList { /** * adds a element to the list * @ param str String Element to add */ public void add ( String str ) { } }
curr . next = new Entry ( str , Entry . NUL ) ; curr = curr . next ; count ++ ;
public class JawrWatchEventProcessor { /** * ( non - Javadoc ) * @ see java . lang . Thread # run ( ) */ @ Override public void run ( ) { } }
while ( ! stopProcessing . get ( ) ) { try { JawrWatchEvent evt = watchEvents . take ( ) ; AtomicBoolean processingBundle = bundlesHandler . isProcessingBundle ( ) ; synchronized ( processingBundle ) { // Wait until processing ends while ( processingBundle . get ( ) && ! stopProcessing . get ( ) ) { try { processingBun...
public class IotHubResourcesInner { /** * Get the security metadata for an IoT hub . For more information , see : https : / / docs . microsoft . com / azure / iot - hub / iot - hub - devguide - security . * Get the security metadata for an IoT hub . For more information , see : https : / / docs . microsoft . com / az...
ServiceResponse < Page < SharedAccessSignatureAuthorizationRuleInner > > response = listKeysNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < SharedAccessSignatureAuthorizationRuleInner > ( response . body ( ) ) { @ Override public Page < SharedAccessSignatureAuthorizationRuleI...
public class RadarChart { /** * * * * * * Private Methods * * * * * */ private void resize ( ) { } }
double width = getWidth ( ) - getInsets ( ) . getLeft ( ) - getInsets ( ) . getRight ( ) ; double height = getHeight ( ) - getInsets ( ) . getTop ( ) - getInsets ( ) . getBottom ( ) ; size = width < height ? width : height ; if ( size > 0 ) { pane . setMaxSize ( size , size ) ; pane . relocate ( ( getWidth ( ) - size )...
public class CronDescriptor { /** * Provide description for month . * @ param fields - fields to describe ; * @ return description - String */ public String describeMonth ( final Map < CronFieldName , CronField > fields ) { } }
final String description = DescriptionStrategyFactory . monthsInstance ( resourceBundle , fields . containsKey ( CronFieldName . MONTH ) ? fields . get ( CronFieldName . MONTH ) . getExpression ( ) : null ) . describe ( ) ; return addTimeExpressions ( description , resourceBundle . getString ( "month" ) , resourceBundl...
public class CommerceRegionUtil { /** * Returns the last commerce region in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching commerce region , or < code > null < / cod...
return getPersistence ( ) . fetchByUuid_Last ( uuid , orderByComparator ) ;
public class DecoratorUtils { /** * Resolves the truly underlying object in a possible chain of { @ link org . apache . gobblin . util . Decorator } . * @ param obj object to resolve . * @ return the true non - decorator underlying object . */ public static Object resolveUnderlyingObject ( Object obj ) { } }
while ( obj instanceof Decorator ) { obj = ( ( Decorator ) obj ) . getDecoratedObject ( ) ; } return obj ;
public class PrepareRoutingSubnetworks { /** * Deletes all but the largest subnetworks . */ int keepLargeNetworks ( PrepEdgeFilter filter , List < IntArrayList > components ) { } }
if ( components . size ( ) <= 1 ) return 0 ; int maxCount = - 1 ; IntIndexedContainer oldComponent = null ; int allRemoved = 0 ; BooleanEncodedValue accessEnc = filter . getAccessEnc ( ) ; EdgeExplorer explorer = ghStorage . createEdgeExplorer ( filter ) ; for ( IntArrayList component : components ) { if ( maxCount < 0...
public class Ed25519FieldElement { /** * Constant - time conditional move . Well , actually it is a conditional copy . Logic is inspired by * the SUPERCOP implementation at : https : / / github . com / floodyberry / supercop / blob / master / crypto _ sign / ed25519 / ref10 / fe _ cmov . c * @ param val the other f...
org . mariadb . jdbc . internal . com . send . authentication . ed25519 . math . ed25519 . Ed25519FieldElement that = ( org . mariadb . jdbc . internal . com . send . authentication . ed25519 . math . ed25519 . Ed25519FieldElement ) val ; b = - b ; int [ ] result = new int [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) { r...
public class MwsAQCall { /** * Perform a synchronous call with error handling and back - off / retry . * @ return A MwsReader to read the response from . */ @ Override public MwsReader invoke ( ) { } }
HttpPost request = createRequest ( ) ; for ( int retryCount = 0 ; ; retryCount ++ ) { try { HttpResponse response = executeRequest ( request ) ; StatusLine statusLine = response . getStatusLine ( ) ; int status = statusLine . getStatusCode ( ) ; String message = statusLine . getReasonPhrase ( ) ; rhmd = getResponseHead...
public class DaylightModel { /** * Get the atomic number as an non - null integer value . Although pseudo atoms * are not considered by this model the pseudo atoms are intercepted to have * non - null atomic number ( defaults to 0 ) . * @ param atom atom to get the element from * @ return the formal charge */ p...
Integer element = atom . getAtomicNumber ( ) ; if ( element != null ) return element ; if ( atom instanceof IPseudoAtom ) return 0 ; throw new IllegalArgumentException ( "Aromaiticty model requires atomic numbers to be set" ) ;
public class EntryViewBase { /** * The time where the entry view starts ( not the start time of the calendar * entry ) . * @ return the start time of the view ( not of the calendar entry ) */ public final ReadOnlyObjectProperty < LocalTime > startTimeProperty ( ) { } }
if ( startTime == null ) { startTime = new ReadOnlyObjectWrapper < > ( this , "startTime" , _startTime ) ; // $ NON - NLS - 1 $ } return startTime . getReadOnlyProperty ( ) ;
public class ViewPosition { /** * Computes view position and stores it in given { @ code pos } . Note , that view should be already * attached and laid out before calling this method . * @ param pos Output position * @ param view View for which we want to get on - screen location * @ return true if view positio...
return pos . init ( view ) ;
public class ChartBehavior { /** * Includes the javascript that calls the Highcharts library to visualize the * chart . * @ param response the Wicket HeaderResponse * @ param options the options containing the data to display * @ param renderer the JsonRenderer responsible for rendering the options * @ param ...
String chartVarname = this . chart . getJavaScriptVarName ( ) ; String optionsVarname = markupId + "Options" ; String contextVarname = markupId + "ctx" ; String jsonOptions = renderer . toJson ( options ) ; if ( options . getOptionalJavascript ( ) == null ) { response . render ( OnDomReadyHeaderItem . forScript ( Messa...
public class TargetHistoryTable { /** * FREEHEP added synchronized */ private synchronized void update ( final String configId , final String outputName , final String [ ] sources ) { } }
final File outputFile = new File ( this . outputDir , outputName ) ; // if output file doesn ' t exist or predates the start of the // compile step ( most likely a compilation error ) then // do not write add a history entry if ( outputFile . exists ( ) && ! CUtil . isSignificantlyBefore ( outputFile . lastModified ( )...
public class JdbcControlImpl { /** * Set any custom type mappers specifed in the annotation for the connection . Used for mapping SQL UDTs to * java classes . * @ param typeMappers An array of TypeMapper . */ private void setTypeMappers ( TypeMapper [ ] typeMappers ) throws SQLException { } }
if ( typeMappers . length > 0 ) { Map < String , Class < ? > > mappers = _connection . getTypeMap ( ) ; for ( TypeMapper t : typeMappers ) { mappers . put ( t . UDTName ( ) , t . mapperClass ( ) ) ; } _connection . setTypeMap ( mappers ) ; }
public class MultiUserChat { /** * Bans a user from the room . An admin or owner of the room can ban users from a room . This * means that the banned user will no longer be able to join the room unless the ban has been * removed . If the banned user was present in the room then he / she will be removed from the *...
changeAffiliationByAdmin ( jid , MUCAffiliation . outcast , reason ) ;