signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Director { /** * Fires an install progress event to be displayed * @ param progress the progress integer * @ param installAsset the install asset necessitating the progress event * @ throws InstallException */ public void fireInstallProgressEvent ( int progress , InstallAsset installAsset ) throws In...
if ( installAsset . isServerPackage ( ) ) fireProgressEvent ( InstallProgressEvent . DEPLOY , progress , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_DEPLOYING" , installAsset . toString ( ) ) , true ) ; else if ( installAsset . isFeature ( ) ) { ESAAsset esaa = ( ( ESAAsset ) installAsset ) ; if ( esaa ...
public class RadialPickerLayout { /** * Set either the hour or the minute . Will set the internal value , and set the selection . */ private void setItem ( int index , int value ) { } }
if ( index == HOUR_INDEX ) { setValueForItem ( HOUR_INDEX , value ) ; int hourDegrees = ( value % 12 ) * HOUR_VALUE_TO_DEGREES_STEP_SIZE ; mHourRadialSelectorView . setSelection ( hourDegrees , isHourInnerCircle ( value ) , false ) ; mHourRadialSelectorView . invalidate ( ) ; } else if ( index == MINUTE_INDEX ) { setVa...
public class ManagedProcess { /** * Returns the exit value for the subprocess . * @ return the exit value of the subprocess represented by this < code > Process < / code > object . by * convention , the value < code > 0 < / code > indicates normal termination . * @ exception ManagedProcessException if the subproc...
try { return resultHandler . getExitValue ( ) ; } catch ( IllegalStateException e ) { throw new ManagedProcessException ( "Exit Value not (yet) available for " + getProcLongName ( ) , e ) ; }
public class TemplateCodeGenerator { /** * ( non - Javadoc ) * @ see com . baidu . bjf . remoting . protobuf . code . ICodeGenerator # getCode ( ) */ @ Override public String getCode ( ) { } }
String pkg = getPackage ( ) ; if ( ! StringUtils . isEmpty ( pkg ) ) { pkg = "package " + pkg + ";" ; } // set package templator . setVariable ( "package" , pkg ) ; // add loop block for import packages genImportCode ( ) ; // generate class String className = getClassName ( ) ; templator . setVariable ( "className" , c...
public class CodeGenerator { /** * This function adds a comma - separated list as is specified by an ARRAYLIT * node with the associated skipIndexes array . This is a space optimization * since we avoid creating a whole Node object for each empty array literal * slot . * @ param firstInList The first in the nod...
boolean lastWasEmpty = false ; for ( Node n = firstInList ; n != null ; n = n . getNext ( ) ) { if ( n != firstInList ) { cc . listSeparator ( ) ; } addExpr ( n , 1 , Context . OTHER ) ; lastWasEmpty = n . isEmpty ( ) ; } if ( lastWasEmpty ) { cc . listSeparator ( ) ; }
public class SimpleChannelPool { /** * Tries to retrieve healthy channel from the pool if any or creates a new channel otherwise . * @ param promise the promise to provide acquire result . * @ return future for acquiring a channel . */ private Future < Channel > acquireHealthyFromPoolOrNew ( final Promise < Channel...
try { final Channel ch = pollChannel ( ) ; if ( ch == null ) { // No Channel left in the pool bootstrap a new Channel Bootstrap bs = bootstrap . clone ( ) ; bs . attr ( POOL_KEY , this ) ; ChannelFuture f = connectChannel ( bs ) ; if ( f . isDone ( ) ) { notifyConnect ( f , promise ) ; } else { f . addListener ( new Ch...
public class Code { /** * pc is increased by 1. */ public void emitGeneric ( int opcode , Object [ ] args ) { } }
Instruction instr ; InstructionType type ; type = Set . TYPES [ opcode ] ; instr = new Instruction ( - 1 , type , args ) ; instructions . add ( instr ) ;
public class DOM2DTM { /** * Retrieves an attribute node by by qualified name and namespace URI . * @ param nodeHandle int Handle of the node upon which to look up this attribute . . * @ param namespaceURI The namespace URI of the attribute to * retrieve , or null . * @ param name The local name of the attribut...
// % OPT % This is probably slower than it needs to be . if ( null == namespaceURI ) namespaceURI = "" ; int type = getNodeType ( nodeHandle ) ; if ( DTM . ELEMENT_NODE == type ) { // Assume that attributes immediately follow the element . int identity = makeNodeIdentity ( nodeHandle ) ; while ( DTM . NULL != ( identit...
public class PathImpl { /** * Creates the file named by this Path and returns true if the * file is new . */ public boolean createNewFile ( ) throws IOException { } }
synchronized ( LOCK ) { if ( ! exists ( ) ) { clearStatusCache ( ) ; WriteStreamOld s = openWrite ( ) ; s . close ( ) ; return true ; } } return false ;
public class DescribeDefaultAuthorizerRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeDefaultAuthorizerRequest describeDefaultAuthorizerRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeDefaultAuthorizerRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class FastCloner { /** * reflection utils */ private List < Field > allFields ( final Class < ? > c ) { } }
List < Field > l = this . fieldsCache . get ( c ) ; if ( l == null ) { l = new LinkedList < Field > ( ) ; final Field [ ] fields = c . getDeclaredFields ( ) ; addAll ( l , fields ) ; Class < ? > sc = c ; while ( ( ( sc = sc . getSuperclass ( ) ) != Object . class ) && ( sc != null ) ) { addAll ( l , sc . getDeclaredFie...
public class StageCommand { /** * { @ inheritDoc } */ @ Override protected void perform ( final Wave wave ) { } }
LOGGER . info ( "Trigger stage action " + waveBean ( wave ) . action ( ) ) ; switch ( waveBean ( wave ) . action ( ) ) { case show : returnData ( StageService . class , StageService . DO_OPEN_STAGE , waveBean ( wave ) ) ; break ; case hide : returnData ( StageService . class , StageService . DO_CLOSE_STAGE , waveBean (...
public class Smb2TreeDisconnectRequest { /** * { @ inheritDoc } * @ see jcifs . internal . smb2 . ServerMessageBlock2 # writeBytesWireFormat ( byte [ ] , int ) */ @ Override protected int writeBytesWireFormat ( byte [ ] dst , int dstIndex ) { } }
SMBUtil . writeInt2 ( 4 , dst , dstIndex ) ; SMBUtil . writeInt2 ( 0 , dst , dstIndex + 2 ) ; return 4 ;
public class LoadingAnimation { /** * GEN - LAST : event _ formComponentResized */ @ Override public void paint ( Graphics g ) { } }
super . paint ( g ) ; boolean change = indeterminate ; Graphics2D g2 = ( Graphics2D ) g . create ( ) ; updateComponentMiddelpoint ( g2 ) ; for ( int animationPointID = animationPointCount - 1 ; animationPointID >= 0 ; animationPointID -- ) { if ( indeterminate ) { indeterminateAnimation ( g2 , animationPointID ) ; } el...
public class ThreadBoundJschLogger { /** * Set the thread - inherited logger with a loglevel on Jsch * @ param logger logger * @ param loggingLevel level */ private void setThreadLogger ( PluginLogger logger , int loggingLevel ) { } }
pluginLogger . set ( logger ) ; logLevel . set ( loggingLevel ) ; JSch . setLogger ( this ) ;
public class RoundedMoney { /** * ( non - Javadoc ) * @ see MonetaryAmount # negate ( ) */ @ Override public RoundedMoney negate ( ) { } }
MathContext mc = monetaryContext . get ( MathContext . class ) ; if ( mc == null ) { mc = MathContext . DECIMAL64 ; } return new RoundedMoney ( number . negate ( mc ) , currency , rounding ) ;
public class RouteBuilder { /** * Specifies that this route is mapped to HTTP POST method . * @ return instance of { @ link RouteBuilder } . */ public RouteBuilder post ( ) { } }
if ( ! methods . contains ( HttpMethod . POST ) ) { methods . add ( HttpMethod . POST ) ; } return this ;
public class TapestryExtension { /** * allow activation of the extension w / o specifying any modules . */ private Set < Class < ? > > collectModules ( SpecInfo spec ) { } }
Set < Class < ? > > modules = null ; for ( SpecInfo curr : spec . getSpecsTopToBottom ( ) ) { if ( importModuleAnnotation != null && spec . isAnnotationPresent ( importModuleAnnotation ) ) { org . apache . tapestry5 . ioc . annotations . ImportModule importModule = curr . getAnnotation ( org . apache . tapestry5 . ioc ...
public class VMath { /** * Set a submatrix . * @ param m1 Input matrix * @ param r Array of row indices . * @ param c0 Initial column index * @ param c1 Final column index ( exclusive ) * @ param m2 New values for m1 ( r ( : ) , c0 : c1-1) */ public static void setMatrix ( final double [ ] [ ] m1 , final int ...
assert c0 <= c1 : ERR_INVALID_RANGE ; assert c1 <= m1 [ 0 ] . length : ERR_MATRIX_DIMENSIONS ; for ( int i = 0 ; i < r . length ; i ++ ) { System . arraycopy ( m2 [ i ] , 0 , m1 [ r [ i ] ] , c0 , c1 - c0 ) ; }
public class ParserUtils { /** * Returns a list of ColumnMetaData objects . This is for use with delimited * files . The first line of the file which contains data will be used as the * column names * @ param line * @ param delimiter * @ param qualifier * @ param p * PZParser used to specify additional op...
final List < ColumnMetaData > results = new ArrayList < > ( ) ; final Set < String > dupCheck = new HashSet < > ( ) ; final List < String > lineData = splitLine ( line , delimiter , qualifier , FPConstants . SPLITLINE_SIZE_INIT , false , false ) ; for ( final String colName : lineData ) { final ColumnMetaData cmd = new...
public class Matrix3x2d { /** * Apply a translation to this matrix by translating by the given number of units in x and y and store the result * in < code > dest < / code > . * If < code > M < / code > is < code > this < / code > matrix and < code > T < / code > the translation * matrix , then the new matrix will...
double rm20 = x ; double rm21 = y ; dest . m20 = m00 * rm20 + m10 * rm21 + m20 ; dest . m21 = m01 * rm20 + m11 * rm21 + m21 ; dest . m00 = m00 ; dest . m01 = m01 ; dest . m10 = m10 ; dest . m11 = m11 ; return dest ;
public class FirestoreClient { /** * Commits a transaction , while optionally updating documents . * < p > Sample code : * < pre > < code > * try ( FirestoreClient firestoreClient = FirestoreClient . create ( ) ) { * String formattedDatabase = DatabaseRootName . format ( " [ PROJECT ] " , " [ DATABASE ] " ) ; ...
CommitRequest request = CommitRequest . newBuilder ( ) . setDatabase ( database ) . addAllWrites ( writes ) . build ( ) ; return commit ( request ) ;
public class StanfordAgigaSentence { /** * / * ( non - Javadoc ) * @ see edu . jhu . hltcoe . sp . data . depparse . AgigaSentence # getStanfordContituencyTree ( ) */ public Tree getStanfordContituencyTree ( ) { } }
TreeFactory tf = new LabeledScoredTreeFactory ( ) ; StringReader r = new StringReader ( getParseText ( ) ) ; TreeReader tr = new PennTreeReader ( r , tf ) ; try { return tr . readTree ( ) ; } catch ( IOException e ) { throw new RuntimeException ( "Error: IOException should not be thrown by StringReader" ) ; }
public class FileDeleteFromComputeNodeOptions { /** * Set the time the request was issued . Client libraries typically set this to the current system clock time ; set it explicitly if you are calling the REST API directly . * @ param ocpDate the ocpDate value to set * @ return the FileDeleteFromComputeNodeOptions o...
if ( ocpDate == null ) { this . ocpDate = null ; } else { this . ocpDate = new DateTimeRfc1123 ( ocpDate ) ; } return this ;
public class WaitingWordsi { /** * Adds the context vector to the end of the list of context vectors * associated with { @ code focusKey } . */ public void handleContextVector ( String focusKey , String secondaryKey , SparseDoubleVector context ) { } }
// Get the list of context vectors for the focus key . List < SparseDoubleVector > termContexts = dataVectors . get ( focusKey ) ; if ( termContexts == null ) { synchronized ( this ) { termContexts = dataVectors . get ( focusKey ) ; if ( termContexts == null ) { termContexts = new ArrayList < SparseDoubleVector > ( ) ;...
public class MPAlarmManager { /** * Create a new alarm . * @ param delta The amount of time before the alarm should be fired , in ms * @ param percentLate The percentage by which the alarm can be late * @ param listener The alarm listener which is called when the alarm fires . * @ param context A context object...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "create" , new Object [ ] { this , Long . valueOf ( delta ) , Integer . valueOf ( percentLate ) , listener , context } ) ; // calculate the target time for the new alarm long time = System . currentTimeMillis ( ) + delta ; /...
public class MultiImageForm { /** * Check to make sure the client hasn ' t exceeded the maximum allowed upload * size inside of this validate method . */ public ActionErrors validate ( ActionMapping mapping , HttpServletRequest request ) { } }
ActionErrors errors = null ; // has the maximum length been exceeded ? Boolean maxLengthExceeded = ( Boolean ) request . getAttribute ( MultipartRequestHandler . ATTRIBUTE_MAX_LENGTH_EXCEEDED ) ; if ( ( maxLengthExceeded != null ) && ( maxLengthExceeded . booleanValue ( ) ) ) { errors = new ActionErrors ( ) ; errors . ...
public class MMDCfgPanel { /** * GEN - LAST : event _ spinnerConnectorWidthStateChanged */ private void colorChooserConnectorColorActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ colorChooserConnectorColorActionPerformed if ( this . colorChooserConnectorColor . isLastOkPressed ( ) && changeNotificationAllowed ) { this . controller . changed ( ) ; }
public class FileTree { /** * Return a filtered set of resources * @ param path path * @ param test predicate test , or null to match all * @ return set of matching resources */ private Set < Resource < T > > filterResources ( Path path , Predicate < Resource > test ) { } }
validatePath ( path ) ; if ( ! hasDirectory ( path ) ) { throw StorageException . listException ( path , "not a directory path: " + path ) ; } File file = filepathMapper . directoryForPath ( path ) ; HashSet < Resource < T > > files = new HashSet < Resource < T > > ( ) ; try { for ( File file1 : file . listFiles ( ) ) ...
public class SeekBarPreference { /** * Sets the symbol , which should be used to separate floating point numbers for textual * representation . * @ param floatingPointSeparator * The symbol , which should be set , as an instance of the type { @ link CharSequence } or * null , if the default symbol should be use...
if ( floatingPointSeparator != null ) { Condition . INSTANCE . ensureAtMaximum ( floatingPointSeparator . length ( ) , 1 , "The floating point separator's length must be 1" ) ; } this . floatingPointSeparator = floatingPointSeparator ;
public class BSHAllocationExpression { /** * Fill boxed numeric types with default numbers instead of nulls . * @ param arr the array to fill . */ private void arrayFillDefaultValue ( Object arr ) { } }
if ( null == arr ) return ; Class < ? > clas = arr . getClass ( ) ; Class < ? > comp = Types . arrayElementType ( clas ) ; if ( ! comp . isPrimitive ( ) ) if ( Types . arrayDimensions ( clas ) > 1 ) for ( int i = 0 ; i < Array . getLength ( arr ) ; i ++ ) arrayFillDefaultValue ( Array . get ( arr , i ) ) ; else Arrays ...
public class KEYConverter { /** * Builds a DNSKEY or KEY record from a PublicKey */ public static Record buildRecord ( Name name , int type , int dclass , long ttl , int flags , int proto , int alg , PublicKey key ) { } }
byte [ ] data ; if ( type != Type . KEY && type != Type . DNSKEY ) throw new IllegalArgumentException ( "type must be KEY " + "or DNSKEY" ) ; if ( key instanceof RSAPublicKey ) { data = buildRSA ( ( RSAPublicKey ) key ) ; } else if ( key instanceof DHPublicKey ) { data = buildDH ( ( DHPublicKey ) key ) ; } else if ( ke...
public class BookMgrImpl { /** * query */ public Book get ( int id , String name ) { } }
System . out . println ( "this is get(id, name)" ) ; if ( bookMap . containsKey ( id ) && bookMap . containsKey ( name ) ) { return bookMap . get ( id ) ; } return null ;
public class Utils { /** * Throws a { @ link NullPointerException } if the argument is null . This method is similar to { @ code * Preconditions . checkNotNull ( Object , Object ) } from Guava . * @ param arg the argument to check for null . * @ param errorMessage the message to use for the exception . Will be co...
if ( arg == null ) { throw new NullPointerException ( String . valueOf ( errorMessage ) ) ; } return arg ;
public class CmsEditSiteForm { /** * Returns the correct varaint of a resource name accoreding to locale . < p > * @ param path where the considered resource is . * @ param baseName of the resource * @ return localized name of resource */ private String getAvailableLocalVariant ( String path , String baseName ) {...
// First look for a bundle with the locale of the folder . . try { CmsProperty propLoc = m_clonedCms . readPropertyObject ( path , CmsPropertyDefinition . PROPERTY_LOCALE , true ) ; if ( ! propLoc . isNullProperty ( ) ) { if ( m_clonedCms . existsResource ( path + baseName + "_" + propLoc . getValue ( ) ) ) { return ba...
public class EvernoteUtil { /** * Create an ENML & lt ; en - media & gt ; tag for the specified Resource object . */ public static String createEnMediaTag ( Resource resource ) { } }
return "<en-media hash=\"" + bytesToHex ( resource . getData ( ) . getBodyHash ( ) ) + "\" type=\"" + resource . getMime ( ) + "\"/>" ;
public class SuspiciousComparatorReturnValues { /** * implements the visitor to check to see what Const were returned from a comparator . If no Const were returned it can ' t determine anything , however if only * Const were returned , it looks to see if negative positive and zero was returned . It also looks to see ...
if ( getMethod ( ) . isSynthetic ( ) ) { return ; } String methodName = getMethodName ( ) ; String methodSig = getMethodSig ( ) ; if ( methodName . equals ( methodInfo . methodName ) && methodSig . endsWith ( methodInfo . signatureEnding ) && ( SignatureUtils . getNumParameters ( methodSig ) == methodInfo . argumentCou...
public class ReportExecutor { /** * End the application . */ private void endApplication ( @ Nullable Thread uncaughtExceptionThread , Throwable th ) { } }
final boolean letDefaultHandlerEndApplication = config . alsoReportToAndroidFramework ( ) ; final boolean handlingUncaughtException = uncaughtExceptionThread != null ; if ( handlingUncaughtException && letDefaultHandlerEndApplication && defaultExceptionHandler != null ) { // Let the system default handler do it ' s job...
public class BundleUtils { /** * Returns a list of all bundles with the given symbolic name . * @ param bc bundle context * @ param symbolicName bundle symbolic name * @ return matching bundles . The list may be empty , but never null . */ public static List < Bundle > getBundles ( BundleContext bc , String symbo...
List < Bundle > bundles = new ArrayList < Bundle > ( ) ; for ( Bundle bundle : bc . getBundles ( ) ) { if ( bundle . getSymbolicName ( ) . equals ( symbolicName ) ) { bundles . add ( bundle ) ; } } return bundles ;
public class Rc4Utils { /** * Generates a 128 - bit key ( 16 bytes ) randomly for RC4 encryption / decryption . * @ return generated key bytes */ public static byte [ ] generateKey ( ) { } }
CipherKeyGenerator cipherKeyGenerator = new CipherKeyGenerator ( ) ; cipherKeyGenerator . init ( new KeyGenerationParameters ( new SecureRandom ( ) , 128 ) ) ; return cipherKeyGenerator . generateKey ( ) ;
public class Base64 { /** * Decodes a BASE64 encoded string that is known to be resonably well formatted . The method is about twice as * fast as { @ link # decode ( String ) } . The preconditions are : < br > * + The array must have a line length of 76 chars OR no line separators at all ( one line ) . < br > * +...
// Check special case int sLen = s . length ( ) ; if ( sLen == 0 ) { return new byte [ 0 ] ; } int sIx = 0 , eIx = sLen - 1 ; // Start and end index after trimming . // Trim illegal chars from start if ( ! urlSafe ) { while ( sIx < eIx && IA [ s . charAt ( sIx ) & 0xff ] < 0 ) { sIx ++ ; } } else { while ( sIx < eIx &&...
public class FormLayout { /** * Computes and returns the grid ' s origins . * @ param container the layout container * @ param totalSize the total size to assign * @ param offset the offset from left or top margin * @ param formSpecs the column or row specs , resp . * @ param componentListsthe components list...
/* For each spec compute the minimum and preferred size that is * the maximum of all component minimum and preferred sizes resp . */ int [ ] minSizes = maximumSizes ( container , formSpecs , componentLists , minMeasure , prefMeasure , minMeasure ) ; int [ ] prefSizes = maximumSizes ( container , formSpecs , component...
public class JvmTypeReferenceBuilder { /** * Creates a new { @ link JvmTypeReference } pointing to the given class and containing the given type arguments . * @ param type * the type the reference shall point to . * @ param typeArgs * type arguments * @ return the newly created { @ link JvmTypeReference } */ ...
int typeParams = 0 ; if ( type instanceof JvmGenericType ) { typeParams = ( ( JvmGenericType ) type ) . getTypeParameters ( ) . size ( ) ; } if ( typeParams < typeArgs . length ) { throw new IllegalArgumentException ( "The type " + type . getIdentifier ( ) + " only declares " + typeParams + " type parameters. You passe...
public class Util { /** * Given a query result from a SPARQL query , check if the given variable has * a value or not * @ param resultRow the result from a SPARQL query * @ param variableName the name of the variable to obtain * @ return true if the variable has a value , false otherwise */ public static boolea...
if ( resultRow != null ) { return resultRow . contains ( variableName ) ; } return false ;
public class CountdownTimer { /** * @ param now Current unix time * @ param timeUnit Time unit that current time is given in * @ return Amount of time left on the timer , in the time unit that the timer was initialized with . If the timer * never started to begin with , or if the timer has ended , then return a 0...
if ( intervalStartInNanos == - 1 ) { return 0 ; } final long remainingNanos = Math . max ( 0 , timeIntervalInNanos - ( timeUnit . toNanos ( now ) - intervalStartInNanos ) ) ; return TimeUnit . NANOSECONDS . convert ( remainingNanos , this . timeUnit ) ;
public class PdfContentByte { /** * Generates an array of bezier curves to draw an arc . * ( x1 , y1 ) and ( x2 , y2 ) are the corners of the enclosing rectangle . * Angles , measured in degrees , start with 0 to the right ( the positive X * axis ) and increase counter - clockwise . The arc extends from startAng ...
float tmp ; if ( x1 > x2 ) { tmp = x1 ; x1 = x2 ; x2 = tmp ; } if ( y2 > y1 ) { tmp = y1 ; y1 = y2 ; y2 = tmp ; } float fragAngle ; int Nfrag ; if ( Math . abs ( extent ) <= 90f ) { fragAngle = extent ; Nfrag = 1 ; } else { Nfrag = ( int ) ( Math . ceil ( Math . abs ( extent ) / 90f ) ) ; fragAngle = extent / Nfrag ; }...
public class ST_GeometryN { /** * Return Geometry number n from the given GeometryCollection . * @ param geometry GeometryCollection * @ param n Index of Geometry number n in [ 1 - N ] * @ return Geometry number n or Null if parameter is null . * @ throws SQLException */ public static Geometry getGeometryN ( Ge...
if ( geometry == null ) { return null ; } if ( n >= 1 && n <= geometry . getNumGeometries ( ) ) { return geometry . getGeometryN ( n - 1 ) ; } else { throw new SQLException ( OUT_OF_BOUNDS_ERR_MESSAGE ) ; }
public class FATHelper { /** * Reset the marks in all Liberty logs . * @ param server The server for the logs to reset the marks . * @ throws Exception If there was an error resetting the marks . */ public static void resetMarksInLogs ( LibertyServer server ) throws Exception { } }
server . setMarkToEndOfLog ( server . getDefaultLogFile ( ) ) ; server . setMarkToEndOfLog ( server . getMostRecentTraceFile ( ) ) ;
public class Filter { /** * Check the number of parameters and throws an exception if needed . * @ param params * the parameters to check . * @ param expected * the expected number of parameters . */ public final void checkParams ( Object [ ] params , int expected ) { } }
if ( params == null || params . length != expected ) { throw new RuntimeException ( "Liquid error: wrong number of arguments (" + ( params == null ? 0 : params . length + 1 ) + " for " + ( expected + 1 ) + ")" ) ; }
public class EnsureUniqueAssociation { /** * Removes ambiguous associations . Call { @ link # getMatches ( ) } to get the list of unambiguous * matches . * @ param matches List of candidate associations * @ param sizeDst Number of ' dst ' features */ public void process ( FastQueue < AssociatedIndex > matches , i...
// initialize data structures if ( bestScores . length < sizeDst ) bestScores = new AssociatedIndex [ sizeDst ] ; for ( int i = 0 ; i < matches . size ; i ++ ) { AssociatedIndex match = matches . data [ i ] ; if ( bestScores [ match . dst ] == null || match . fitScore < bestScores [ match . dst ] . fitScore ) { bestSco...
public class NumberParser { /** * Parse a Float from a String without exceptions . If the String is not a Float then null is * returned * @ param str the String to parse * @ return The Float represented by the String , or null if it could not be parsed . */ public static Float parseFloat ( final String str ) { } ...
if ( null != str ) { try { return new Float ( Float . parseFloat ( str . trim ( ) ) ) ; } catch ( final Exception e ) { // : IGNORE : } } return null ;
public class SimpleMDAGNode { /** * Follows an outgoing _ transition from this node . * @ param mdagDataArray the array of SimpleMDAGNodes containing this node * @ param letter the char representation of the desired _ transition ' s label * @ return the SimpleMDAGNode that is the target of the _ transition labele...
SimpleMDAGNode targetNode = null ; int offset = binarySearch ( mdagDataArray , letter ) ; if ( offset >= 0 ) { targetNode = mdagDataArray [ offset ] ; } return targetNode ;
public class DescribeClusterTracksResult { /** * A list of maintenance tracks output by the < code > DescribeClusterTracks < / code > operation . * @ param maintenanceTracks * A list of maintenance tracks output by the < code > DescribeClusterTracks < / code > operation . */ public void setMaintenanceTracks ( java ...
if ( maintenanceTracks == null ) { this . maintenanceTracks = null ; return ; } this . maintenanceTracks = new com . amazonaws . internal . SdkInternalList < MaintenanceTrack > ( maintenanceTracks ) ;
public class SchedulerUtility { /** * Convert a text in properties file format to DataMap that can be used by Quartz * @ param textthe text in properties file format * @ return a Map that can be used as JobDataMap by Quartz * @ throws IOException if the text is not in proper properties file format */ public stati...
Map < String , Object > dataMap = null ; Properties p = new Properties ( ) ; p . load ( new StringReader ( text ) ) ; dataMap = new HashMap < String , Object > ( ) ; for ( Entry < Object , Object > entry : p . entrySet ( ) ) { dataMap . put ( ( String ) entry . getKey ( ) , entry . getValue ( ) ) ; } return dataMap ;
public class Proxy { /** * Marks this proxy object as being closed . */ protected void setClosed ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setClosed" ) ; closed = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setClosed" ) ;
public class CmsConfigurationReader { /** * Parses the formatter change set . < p > * @ param basePath the configuration base path * @ param node the parent node * @ param removeAllFormatters flag , indicating if all formatters that are not explicitly added should be removed * @ return the formatter change set ...
Set < String > addFormatters = parseAddFormatters ( node ) ; addFormatters . addAll ( readLocalFormatters ( node ) ) ; Set < String > removeFormatters = removeAllFormatters ? new HashSet < String > ( ) : parseRemoveFormatters ( node ) ; String siteRoot = null ; if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( basePath...
public class CPInstancePersistenceImpl { /** * Clears the cache for the cp instance . * The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */ @ Override public void clearCache ( CPInstance cpInstance ) { } }
entityCache . removeResult ( CPInstanceModelImpl . ENTITY_CACHE_ENABLED , CPInstanceImpl . class , cpInstance . getPrimaryKey ( ) ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ; clearUniqueFindersCache ( ( CPInstanceModel...
public class TypeUtils { /** * < p > Checks if the subject type may be implicitly cast to the target type * following the Java generics rules . < / p > * @ param type the subject type to be assigned to the target type * @ param toType the target type * @ param typeVarAssigns optional map of type variable assign...
if ( toType == null || toType instanceof Class < ? > ) { return isAssignable ( type , ( Class < ? > ) toType ) ; } if ( toType instanceof ParameterizedType ) { return isAssignable ( type , ( ParameterizedType ) toType , typeVarAssigns ) ; } if ( toType instanceof GenericArrayType ) { return isAssignable ( type , ( Gene...
public class AstNodeFactory { /** * Constructs an { @ link AstNode } with the given string name * @ param name the name property of the node ; may not be null * @ return the tree node */ public AstNode node ( String name ) { } }
CheckArg . isNotNull ( name , "name" ) ; AstNode node = new AstNode ( name ) ; node . setProperty ( JCR_PRIMARY_TYPE , NT_UNSTRUCTURED ) ; return node ;
public class PersistenceController { /** * Get single conversations from store implementation as an Observable . * @ return Observable returning single conversation from store . */ Observable < ChatConversationBase > getConversation ( @ NonNull String conversationId ) { } }
return Observable . create ( emitter -> storeFactory . execute ( new StoreTransaction < ChatStore > ( ) { @ Override protected void execute ( ChatStore store ) { store . open ( ) ; ChatConversationBase c = store . getConversation ( conversationId ) ; store . close ( ) ; emitter . onNext ( c ) ; emitter . onCompleted ( ...
public class SarlEnumerationBuilderImpl { /** * Add a modifier . * @ param modifier the modifier to add . */ public void addModifier ( String modifier ) { } }
if ( ! Strings . isEmpty ( modifier ) ) { this . sarlEnumeration . getModifiers ( ) . add ( modifier ) ; }
public class CmsLock { /** * Returns < code > true < / code > if this is an exclusive , temporary exclusive , or * directly inherited lock , and the given user is the owner of this lock , * checking also the project of the lock . < p > * @ param user the user to compare to the owner of this lock * @ param proje...
return ( isExclusive ( ) || isDirectlyInherited ( ) ) && isOwnedInProjectBy ( user , project ) ;
public class OptionHandlerRegistry { /** * Registers the default handlers . */ private void initHandlers ( ) { } }
registerHandler ( Boolean . class , BooleanOptionHandler . class ) ; registerHandler ( boolean . class , BooleanOptionHandler . class ) ; registerHandler ( File . class , FileOptionHandler . class ) ; registerHandler ( URL . class , URLOptionHandler . class ) ; registerHandler ( URI . class , URIOptionHandler . class )...
public class KriptonLibrary { /** * Method to invoke during application initialization . * @ param contextValue * the context value * @ param executorService * the executor service */ public static void init ( Context contextValue , ExecutorService service ) { } }
context = contextValue ; if ( service == null ) { executerService = Executors . newFixedThreadPool ( THREAD_POOL_SIZE_DEFAULT ) ; } else { executerService = service ; }
public class StreamWriter { /** * Writes an iCalendar object to the data stream . * @ param ical the iCalendar object to write * @ throws IllegalArgumentException if the scribe class for a component or * property object cannot be found ( only happens when an experimental * property / component scribe is not reg...
Collection < Class < ? > > unregistered = findScribeless ( ical ) ; if ( ! unregistered . isEmpty ( ) ) { List < String > classNames = new ArrayList < String > ( unregistered . size ( ) ) ; for ( Class < ? > clazz : unregistered ) { classNames . add ( clazz . getName ( ) ) ; } throw Messages . INSTANCE . getIllegalArgu...
public class RuleCallImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case XtextPackage . RULE_CALL__RULE : return rule != null ; case XtextPackage . RULE_CALL__ARGUMENTS : return arguments != null && ! arguments . isEmpty ( ) ; case XtextPackage . RULE_CALL__EXPLICITLY_CALLED : return explicitlyCalled != EXPLICITLY_CALLED_EDEFAULT ; } return super . eIsSet ( featu...
public class Html5WebSocket { /** * { @ inheritDoc } */ @ Override public void send ( @ Nonnull final ArrayBufferView data ) throws IllegalStateException { } }
checkConnected ( ) ; _webSocket . send ( data ) ;
public class DbUtil { /** * Runs a SQL query that returns a single integer value . * @ param stmt The < code > PreparedStatement < / code > to run . * @ param def The default value to return if the query returns no results . * @ return The value returned by the query , or < code > def < / code > if the * query ...
ResultSet rs = null ; try { rs = stmt . executeQuery ( ) ; if ( rs . next ( ) ) { int value = rs . getInt ( 1 ) ; if ( ! rs . wasNull ( ) ) { return value ; } } return def ; } finally { close ( rs ) ; }
public class MethodUtils { /** * < p > Gets the annotation object with the given annotation type that is present on the given method * or optionally on any equivalent method in super classes and interfaces . Returns null if the annotation * type was not present . < / p > * < p > Stops searching for an annotation ...
Validate . isTrue ( method != null , "The method must not be null" ) ; Validate . isTrue ( annotationCls != null , "The annotation class must not be null" ) ; if ( ! ignoreAccess && ! MemberUtils . isAccessible ( method ) ) { return null ; } A annotation = method . getAnnotation ( annotationCls ) ; if ( annotation == n...
public class StringManager { /** * Get a string from the underlying resource bundle and format * it with the given set of arguments . * @ param key * @ param args */ public String getString ( final String key , final Object ... args ) { } }
String value = getString ( key ) ; if ( value == null ) { value = key ; } MessageFormat mf = new MessageFormat ( value ) ; mf . setLocale ( locale ) ; return mf . format ( args , new StringBuffer ( ) , null ) . toString ( ) ;
public class MultimapWithProtoValuesSubject { MultimapWithProtoValuesFluentAssertion < M > usingConfig ( FluentEqualityConfig newConfig ) { } }
Subject . Factory < MultimapWithMessageValuesSubject < K , M > , Multimap < K , M > > factory = multimapWithMessageValues ( newConfig ) ; MultimapWithMessageValuesSubject < K , M > newSubject = check ( ) . about ( factory ) . that ( actual ( ) ) ; if ( internalCustomName ( ) != null ) { newSubject = newSubject . named ...
public class FlipTableConverters { /** * Create a table from an array of objects using { @ link String # valueOf } . */ public static String fromObjects ( String [ ] headers , Object [ ] [ ] data ) { } }
if ( headers == null ) throw new NullPointerException ( "headers == null" ) ; if ( data == null ) throw new NullPointerException ( "data == null" ) ; List < String [ ] > stringData = new ArrayList < > ( ) ; for ( Object [ ] row : data ) { String [ ] stringRow = new String [ row . length ] ; for ( int column = 0 ; colum...
public class DoubleTuples { /** * Creates a new array from the contents of the given tuple * @ param t The tuple * @ return The array */ public static double [ ] toArray ( DoubleTuple t ) { } }
int d = t . getSize ( ) ; double result [ ] = new double [ d ] ; for ( int i = 0 ; i < d ; i ++ ) { result [ i ] = t . get ( i ) ; } return result ;
public class Setting { /** * Creates a setting of a custom defined field . * @ param description the title of this setting * @ param field custom Field object from FormsFX * @ param property to be bound , saved / loaded and used for undo / redo * @ return the constructed setting */ public static < F extends Fie...
return new Setting < > ( description , field . label ( description ) , property ) ;
public class RebalanceUtils { /** * Verify store definitions are congruent with cluster definition . * @ param cluster * @ param storeDefs */ public static void validateClusterStores ( final Cluster cluster , final List < StoreDefinition > storeDefs ) { } }
// Constructing a StoreRoutingPlan has the ( desirable in this // case ) side - effect of verifying that the store definition is congruent // with the cluster definition . If there are issues , exceptions are // thrown . for ( StoreDefinition storeDefinition : storeDefs ) { new StoreRoutingPlan ( cluster , storeDefinit...
public class AuditLogUsedEvent { /** * Adds the Active Participant of the User or System that accessed the log * @ param userId The Active Participant ' s User ID * @ param altUserId The Active Participant ' s Alternate UserID * @ param userName The Active Participant ' s UserName * @ param networkId The Active...
addActiveParticipant ( userId , altUserId , userName , true , null , networkId ) ;
public class DirectedGraphAdaptor { /** * { @ inheritDoc } */ public int outDegree ( int vertex ) { } }
int degree = 0 ; Set < T > edges = getAdjacencyList ( vertex ) ; for ( T e : edges ) { if ( e . from ( ) == vertex ) degree ++ ; } return degree ;
public class AbstractJobLauncher { /** * Staging data cannot be cleaned if exactly once semantics is used , and the job has unfinished * commit sequences . */ private boolean canCleanStagingData ( JobState jobState ) throws IOException { } }
return this . jobContext . getSemantics ( ) != DeliverySemantics . EXACTLY_ONCE || ! this . jobContext . getCommitSequenceStore ( ) . get ( ) . exists ( jobState . getJobName ( ) ) ;
public class DBIFactory { /** * Build a fully configured DBI instance managed by the DropWizard lifecycle * with the configured health check ; this method should not be overridden * ( instead , override { @ link # configure ( DBI , PooledDataSourceFactory ) } and / or * { @ link # newInstance ( ManagedDataSource ...
// Create the instance final DBI dbi = this . newInstance ( dataSource ) ; // Manage the data source that created this instance . environment . lifecycle ( ) . manage ( dataSource ) ; // Setup the required health checks . final Optional < String > validationQuery = configuration . getValidationQuery ( ) ; environment ....
public class EncoderUtil { /** * Encodes the specified text into an encoded word or a sequence of encoded * words separated by space . The text is separated into a sequence of encoded * words if it does not fit in a single one . * @ param text * text to encode . * @ param usage * whether the encoded - word ...
if ( text == null ) throw new IllegalArgumentException ( ) ; if ( usedCharacters < 0 || usedCharacters > MAX_USED_CHARACTERS ) throw new IllegalArgumentException ( ) ; if ( charset == null ) charset = determineCharset ( text ) ; String mimeCharset = charset . name ( ) ; // no canonical names needed if ( mimeCharset == ...
public class CreateKeyRequest { /** * One or more tags . Each tag consists of a tag key and a tag value . Tag keys and tag values are both required , but * tag values can be empty ( null ) strings . * Use this parameter to tag the CMK when it is created . Alternately , you can omit this parameter and instead tag ...
if ( tags == null ) { this . tags = null ; return ; } this . tags = new com . ibm . cloud . objectstorage . internal . SdkInternalList < Tag > ( tags ) ;
public class IntLongDenseVector { /** * Updates this vector to be the entrywise product ( i . e . Hadamard product ) of this vector with the other . */ public void product ( IntLongVector other ) { } }
// TODO : Add special case for IntLongDenseVector . for ( int i = 0 ; i < idxAfterLast ; i ++ ) { elements [ i ] *= other . get ( i ) ; }
public class LdapTemplate { /** * { @ inheritDoc } */ @ Override public < T > List < T > search ( String base , String filter , SearchControls controls , AttributesMapper < T > mapper , DirContextProcessor processor ) { } }
AttributesMapperCallbackHandler < T > handler = new AttributesMapperCallbackHandler < T > ( mapper ) ; search ( base , filter , controls , handler , processor ) ; return handler . getList ( ) ;
public class AmazonEC2Waiters { /** * Builds a VolumeAvailable waiter by using custom parameters waiterParameters and other parameters defined in the * waiters specification , and then polls until it determines whether the resource entered the desired state or not , * where polling criteria is bound by either defau...
return new WaiterBuilder < DescribeVolumesRequest , DescribeVolumesResult > ( ) . withSdkFunction ( new DescribeVolumesFunction ( client ) ) . withAcceptors ( new VolumeAvailable . IsAvailableMatcher ( ) , new VolumeAvailable . IsDeletedMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsR...
public class InternalContext { /** * Create a peer - context used by include / import . * Only share locals and out * @ param template template * @ param indexers indexers * @ param varSize var size * @ param rootParams root params * @ return a new peer context */ public InternalContext createPeerContext ( ...
InternalContext newContext = new InternalContext ( template , this . out , rootParams , indexers , varSize , null ) ; newContext . localContext = this ; return newContext ;
public class ClientSessionManager { /** * Kills the client session manager . * @ return A completable future to be completed once the session manager is killed . */ public CompletableFuture < Void > kill ( ) { } }
return CompletableFuture . runAsync ( ( ) -> { if ( keepAlive != null ) keepAlive . cancel ( ) ; state . setState ( Session . State . CLOSED ) ; } , context . executor ( ) ) ;
public class GoogleDefaultChannelBuilder { /** * " Overrides " the static method in { @ link ManagedChannelBuilder } . */ public static GoogleDefaultChannelBuilder forAddress ( String name , int port ) { } }
return forTarget ( GrpcUtil . authorityFromHostAndPort ( name , port ) ) ;
public class PinViewBaseHelper { /** * Set results in current { @ link PinView } , considering the number of character PinBoxes and each PinBox . * @ param pinResults saved results to set */ void setPinResults ( String pinResults ) { } }
for ( int i = 0 ; i < mNumberPinBoxes ; i ++ ) { if ( pinResults != null ) { int start = i * mNumberCharacters ; String valuePinBox = pinResults . substring ( start , start + mNumberCharacters ) ; if ( ! valuePinBox . trim ( ) . isEmpty ( ) ) { getPinBox ( i ) . setText ( valuePinBox ) ; } else { break ; } } }
public class Packer { /** * Sets the usage of Hash - MAC for authentication ( default no ) * @ param hMacAlg * HMAC algorithm ( HmacSHA1 , HmacSHA256 , . . . ) * @ param passphrase * shared secret * @ return * @ throws NoSuchAlgorithmException * @ throws InvalidKeyException * @ see { @ link javax . cryp...
hMac = Mac . getInstance ( hMacAlg ) ; // " HmacSHA256" hMac . init ( new SecretKeySpec ( passphrase . getBytes ( charsetUTF8 ) , hMacAlg ) ) ; return this ;
public class JVMId { /** * Compare TaskInProgressIds by first jobIds , then by tip numbers . Reduces are * defined as greater then maps . */ @ Override public int compareTo ( org . apache . hadoop . mapreduce . ID o ) { } }
JVMId that = ( JVMId ) o ; int jobComp = this . jobId . compareTo ( that . jobId ) ; if ( jobComp == 0 ) { if ( this . isMap == that . isMap ) { return this . id - that . id ; } else { return this . isMap ? - 1 : 1 ; } } else { return jobComp ; }
public class BatchListIncomingTypedLinksResponse { /** * Returns one or more typed link specifiers as output . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setLinkSpecifiers ( java . util . Collection ) } or { @ link # withLinkSpecifiers ( java . util . Co...
if ( this . linkSpecifiers == null ) { setLinkSpecifiers ( new java . util . ArrayList < TypedLinkSpecifier > ( linkSpecifiers . length ) ) ; } for ( TypedLinkSpecifier ele : linkSpecifiers ) { this . linkSpecifiers . add ( ele ) ; } return this ;
public class BufferingXmlWriter { /** * Low - level ( pass - through ) methods */ @ Override public void close ( boolean forceRealClose ) throws IOException { } }
flush ( ) ; mTextWriter = null ; mAttrValueWriter = null ; // Buffers to free ? char [ ] buf = mOutputBuffer ; if ( buf != null ) { mOutputBuffer = null ; mConfig . freeFullCBuffer ( buf ) ; } // Plus may need to close the actual writer if ( forceRealClose || mAutoCloseOutput ) { /* 14 - Nov - 2008 , TSa : To resolve [...
public class PrepareRequestInterceptor { /** * Method to construct the IPS URI * @ param action * the entity name * @ param context * the context * @ return the IPS URI * @ throws FMSException * the FMSException */ private String prepareIPSUri ( String action , Context context ) throws FMSException { } }
StringBuilder uri = new StringBuilder ( ) ; uri . append ( Config . getProperty ( Config . BASE_URL_PLATFORMSERVICE ) ) . append ( "/" ) . append ( context . getAppDBID ( ) ) . append ( "?act=" ) . append ( action ) . append ( "&token=" ) . append ( context . getAppToken ( ) ) ; return uri . toString ( ) ;
public class FactionWarfareApi { /** * List of the top corporations in faction warfare ( asynchronously ) Top 10 * leaderboard of corporations for kills and victory points separated by * total , last week and yesterday - - - This route expires daily at 11:05 * @ param datasource * The server name you would like...
com . squareup . okhttp . Call call = getFwLeaderboardsCorporationsValidateBeforeCall ( datasource , ifNoneMatch , callback ) ; Type localVarReturnType = new TypeToken < FactionWarfareLeaderboardCorporationsResponse > ( ) { } . getType ( ) ; apiClient . executeAsync ( call , localVarReturnType , callback ) ; return cal...
public class SparseHashDoubleVector { /** * { @ inheritDoc } */ public int [ ] getNonZeroIndices ( ) { } }
if ( nonZeroIndices == null ) { nonZeroIndices = vector . keys ( ) ; Arrays . sort ( nonZeroIndices ) ; } return nonZeroIndices ;
public class ComposableBody { /** * { @ inheritDoc } */ public String toXML ( ) { } }
String comp = computed . get ( ) ; if ( comp == null ) { comp = computeXML ( ) ; computed . set ( comp ) ; } return comp ;
public class AbstractSpecWithPrimaryKey { /** * Sets the primary key with the specified hash - only key name and value . */ public AbstractSpecWithPrimaryKey < T > withPrimaryKey ( String hashKeyName , Object hashKeyValue ) { } }
if ( hashKeyName == null ) throw new IllegalArgumentException ( ) ; withPrimaryKey ( new PrimaryKey ( hashKeyName , hashKeyValue ) ) ; return this ;
public class XmlCharacters { /** * Determine if the supplied name is a valid XML Name . * @ param name the string being checked * @ return true if the supplied name is indeed a valid XML Name , or false otherwise */ public static boolean isValidName ( String name ) { } }
if ( name == null || name . length ( ) == 0 ) return false ; CharacterIterator iter = new StringCharacterIterator ( name ) ; char c = iter . first ( ) ; if ( ! isValidNameStart ( c ) ) return false ; while ( c != CharacterIterator . DONE ) { if ( ! isValidName ( c ) ) return false ; c = iter . next ( ) ; } return true ...
public class DefaultNamingStrategy { @ Override public String getColumnName ( Facet facet ) { } }
Column column = facet . getAnnotation ( Column . class ) ; return column == null ? underscoreSeparated ( facet . getName ( ) ) : column . value ( ) ;
public class V1OperationsModel { /** * { @ inheritDoc } */ @ Override public OperationsModel addOperation ( OperationModel operation ) { } }
addChildModel ( operation ) ; _operations . add ( operation ) ; return this ;